﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Globalization;
using System.Collections;

namespace MovieRental_Presentation.Converters
{
	public class CartApplyButtonEnabledConverter : IMultiValueConverter
	{
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            string customerName = values.OfType<string>().First();
            bool hasItems = values.OfType<bool>().First();
            if (hasItems && customerName.Length > 0)
                return true;
            else
                return false;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}